﻿using System.Threading.Tasks;
using Codeflows;
using Codeflows.Results;

namespace CodeflowsTests.Scenarios
{
    public class AsyncCodeflowWithRetry : Codeflow
    {        
        public Task<Result> Start(IActionContext actionContext)
        {
            return Task.Factory.StartNew(() => actionContext.DispatchAttemptsCount == 1 ? Retry() : End());
        }
    }
}